// function Person(name, age) {
//     this.name = name
//     this.age = age
// }
// Person.prototype.say = function () {
//     console.log(this.name + 'sayhi')
// }
// let xiaoming = new Person('小明', 10)
// xiaoming.say()


class Person {
    constructor(name, age) {
        this.name = name
        this.age = age
    }
    // 类原型对象共有方法
    say() {
        console.log(this.name + 'sayhi')
    }
    // 静态属性 构造函数的方法
    static aa() {
        console.log('aaa')
    }
}

let xiaohua = new Person('xiaohua', 20)
xiaohua.say()
Person.aa()